package com.qfedu.wfx.manager.controller;

import com.google.gson.Gson;
import com.qfedu.wfx.manager.pojos.ParentModule;
import com.qfedu.wfx.manager.service.Impl.ModuleServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("")
public class ModuleController {

    @Autowired
    private ModuleServiceImpl moduleService;

    @RequestMapping("")
    public String index(){
        return "index";
    }

    @RequestMapping("/list")
    @ResponseBody
    public List<ParentModule> list(){
        return moduleService.listModels("admin");
    }
}
